/*
 * Copyright© 2003-2019 浙江汇信科技有限公司, All Rights Reserved. 
 */
package com.icinfo.cloud.provider.punish.csource.manage.controller;

import com.icinfo.cloud.provider.punish.csource.manage.dto.CaseSourceCluHandoutRecordDto;
import com.icinfo.cloud.provider.punish.csource.manage.service.ICaseSourceCluHandoutRecordService;
import com.icinfo.framework.common.web.Result;
import com.icinfo.framework.core.web.BaseController;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 描述: 案源线索派发记录表（含分派+指派） case_source_clu_handout_record 对应的Controller类.<br>
 *
 * @author framework generator
 * @date 2022年08月12日
 */
@RestController
@RequestMapping("/caseSource/cluHandoutRecord")
public class CaseSourceCluHandoutRecordController extends BaseController {
    /**
     * 日志记录器
     */
    private static final Logger logger = LoggerFactory.getLogger(CaseSourceCluHandoutRecordController.class);

    @Autowired
    private ICaseSourceCluHandoutRecordService caseSourceCluHandoutRecordService;

    /**
     * 案源分派保存
     * @param caseSourceCluHandoutRecordDto
     * @return
     */
    @PostMapping("/saveCaseSourceAssign")
    public Result saveCaseSourceAssign(@RequestBody @Validated CaseSourceCluHandoutRecordDto caseSourceCluHandoutRecordDto){
        caseSourceCluHandoutRecordService.saveCaseSourceAssign(caseSourceCluHandoutRecordDto);
        return Result.success("新增案源分派成功");
    }


    /**
     * 案源指派保存
     * @param caseSourceCluHandoutRecordDto
     * @return
     */
    @PostMapping("/saveCaseSourceAppoint")
    public Result saveCaseSourceAppoint(@RequestBody @Validated CaseSourceCluHandoutRecordDto caseSourceCluHandoutRecordDto){
        caseSourceCluHandoutRecordService.saveCaseSourceAppoint(caseSourceCluHandoutRecordDto);
        return Result.success("新增案源指派成功");
    }
}